{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Title: #Number of Employees Who Met the Target"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Difficulty: #Easy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Category Title: #Algorithms"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Tag Slug: #array #enumeration"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Name Translated: #数组 #枚举"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solution Name: numberOfEmployeesWhoMetTarget"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Title: #满足目标工作时长的员工数目"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Content:\n",
    "<p>公司里共有 <code>n</code> 名员工，按从 <code>0</code> 到 <code>n - 1</code> 编号。每个员工 <code>i</code> 已经在公司工作了 <code>hours[i]</code> 小时。</p>\n",
    "\n",
    "<p>公司要求每位员工工作&nbsp;<strong>至少</strong> <code>target</code> 小时。</p>\n",
    "\n",
    "<p>给你一个下标从 <strong>0</strong> 开始、长度为 <code>n</code> 的非负整数数组 <code>hours</code> 和一个非负整数 <code>target</code> 。</p>\n",
    "\n",
    "<p>请你用整数表示并返回工作至少 <code>target</code> 小时的员工数。</p>\n",
    "\n",
    "<p>&nbsp;</p>\n",
    "\n",
    "<p><strong>示例 1：</strong></p>\n",
    "\n",
    "<pre><strong>输入：</strong>hours = [0,1,2,3,4], target = 2\n",
    "<strong>输出：</strong>3\n",
    "<strong>解释：</strong>公司要求每位员工工作至少 2 小时。\n",
    "- 员工 0 工作 0 小时，不满足要求。\n",
    "- 员工 1 工作 1 小时，不满足要求。\n",
    "- 员工 2 工作 2 小时，满足要求。\n",
    "- 员工 3 工作 3 小时，满足要求。\n",
    "- 员工 4 工作 4 小时，满足要求。\n",
    "共有 3 位满足要求的员工。\n",
    "</pre>\n",
    "\n",
    "<p><strong>示例 2：</strong></p>\n",
    "\n",
    "<pre><strong>输入：</strong>hours = [5,1,4,2,2], target = 6\n",
    "<strong>输出：</strong>0\n",
    "<strong>解释：</strong>公司要求每位员工工作至少 6 小时。\n",
    "共有 0 位满足要求的员工。\n",
    "</pre>\n",
    "\n",
    "<p>&nbsp;</p>\n",
    "\n",
    "<p><strong>提示：</strong></p>\n",
    "\n",
    "<ul>\n",
    "\t<li><code>1 &lt;= n == hours.length &lt;= 50</code></li>\n",
    "\t<li><code>0 &lt;=&nbsp;hours[i], target &lt;= 10<sup>5</sup></code></li>\n",
    "</ul>\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Description: [number-of-employees-who-met-the-target](https://leetcode.cn/problems/number-of-employees-who-met-the-target/description/)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solutions: [number-of-employees-who-met-the-target](https://leetcode.cn/problems/number-of-employees-who-met-the-target/solutions/)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_cases = ['[0,1,2,3,4]\\n2', '[5,1,4,2,2]\\n6']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        ans = 0\n",
    "        for h in hours:\n",
    "            if h >= target:\n",
    "                ans += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return len([i for i in hours if i>=target])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return len(list(filter(lambda x:x>=target,hours)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        count = 0\n",
    "        for i in hours:\n",
    "            if i >= target:\n",
    "                count += 1\n",
    "        return count\n",
    "            "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(h >= target for h in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        ans=0\n",
    "        for i in hours:\n",
    "            if i>=target:\n",
    "                ans+=1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        count = 0\n",
    "        for i in hours:\n",
    "            if i < target:\n",
    "                continue\n",
    "            else:\n",
    "                count +=1\n",
    "        return count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        t = 0\n",
    "        for h in hours:\n",
    "            if h >= target:\n",
    "                t += 1\n",
    "        \n",
    "        return t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        num=0\n",
    "        for i in hours:\n",
    "            \n",
    "            if i>=target:\n",
    "                num +=1\n",
    "        return num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(i>=target for i in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(i>=target for i in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(x>=target for x in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        sum = 0\n",
    "        for i in hours:\n",
    "            if i >= target:\n",
    "                sum += 1\n",
    "        return sum"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        out = 0\n",
    "        n = len(hours)\n",
    "        for i in range(n):\n",
    "            if hours[i]>= target:\n",
    "                 out = out+1\n",
    "        return out"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        s=0\n",
    "        for i in hours:\n",
    "            if i>=target:s+=1\n",
    "        return s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        ret = 0\n",
    "        for h in hours:\n",
    "            if h >= target:\n",
    "                ret += 1\n",
    "        return ret\n",
    "            "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        hours.sort()\n",
    "        n = len(hours)\n",
    "        num = 0\n",
    "        for i in range(n):\n",
    "            if hours[i] < target:\n",
    "                num += 1\n",
    "        return n - num\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(h >= target for h in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        r=0\n",
    "        for i in hours:\n",
    "            if i >=target:\n",
    "                r+=1\n",
    "        return r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        sum = 0\n",
    "        for x in hours:\n",
    "            if x >= target:\n",
    "                sum += 1\n",
    "        return sum"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum([1 for i in hours if i >= target])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        sat = 0\n",
    "        for i in hours:\n",
    "            if i >= target:\n",
    "                sat += 1\n",
    "        return sat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        count = 0\n",
    "        for i in range(len(hours)):\n",
    "            if hours[i] >= target:\n",
    "                count += 1\n",
    "        return count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        num = 0\n",
    "        for i in hours:\n",
    "            if i >= target:\n",
    "                num += 1\n",
    "        return int(num)\n",
    "                "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "#        sum=0\n",
    "#        for i in hours:\n",
    "#            if i >= target:\n",
    "#                sum += 1\n",
    "#            else:\n",
    "#                pass\n",
    "#        return sum\n",
    "\n",
    "        return sum(s >= target for s in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        employee = 0\n",
    "        for hour in hours:\n",
    "            if hour >= target:\n",
    "                employee += 1\n",
    "        return employee"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(1 for i in hours if i>=target)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(h >= target for h in hours)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        ans=0\n",
    "        for hour in hours:\n",
    "            if hour>=target:\n",
    "                ans+=1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        hours.sort()\n",
    "        l = len(hours)\n",
    "        for i in range(l):\n",
    "            if hours[i] >= target:\n",
    "                return l-i \n",
    "        return 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        ans = 0\n",
    "        for x in hours:\n",
    "            if x >= target:\n",
    "                ans += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        ans=0\n",
    "        for a in hours:\n",
    "            if a >=target:\n",
    "                ans = ans+1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        result=0\n",
    "        for i in hours:\n",
    "            if i>=target:\n",
    "                result+=1\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return len([x for x in hours if x >= target])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "          return len([hour for hour in hours if hour >= target])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        res = 0\n",
    "        for i in hours:\n",
    "            if i >= target:\n",
    "                res += 1\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        hours.sort()\n",
    "        if max(hours) < target:\n",
    "            return 0\n",
    "        for i in range(len(hours)):\n",
    "            if hours[i] >= target:\n",
    "                b = i\n",
    "                break\n",
    "            else:\n",
    "                b = 0\n",
    "        for j in range(b):\n",
    "            hours.remove(hours[0])\n",
    "        return len(hours)     "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return len([i for i in hours if i>=target])\n",
    "\n",
    "       \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return len([hour for hour in hours if hour >= target])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(h >= target for h in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        sum=0\n",
    "        for i in hours:\n",
    "            if i >=target:\n",
    "                sum+=1\n",
    "        return sum "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return len([ans for ans in hours if ans>= target])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "from typing import List\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        \n",
    "        res = 0\n",
    "        for hour in hours:\n",
    "            if hour >= target:\n",
    "                res += 1\n",
    "                \n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        sum=0\n",
    "        for i in hours:\n",
    "            if i >= target:\n",
    "                sum += 1\n",
    "            else:\n",
    "                pass\n",
    "        return sum\n",
    "\n",
    "#        return sum(s >= target for s in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return len([hour for hour in hours if hour >= target])\n",
    "\n",
    "       \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        ans = 0\n",
    "        for shu in hours:\n",
    "            if shu>=target:\n",
    "                ans += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        hours.sort()\n",
    "        len_=len(hours)\n",
    "        for i in range(len_):\n",
    "            if hours[i]>=target:\n",
    "                return len_-i\n",
    "        return 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        nums = 0\n",
    "        for i in hours:\n",
    "            if i >= target:\n",
    "                nums += 1\n",
    "\n",
    "        return nums"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(h >= target for h in hours)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        ans = 0 \n",
    "        for i in hours:\n",
    "            if i >= target:\n",
    "                ans +=1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        cnt = 0\n",
    "        for i in range(len(hours)):\n",
    "            if hours[i] >= target:\n",
    "                cnt += 1\n",
    "        return cnt\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(h >= target for h in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(1 for h in hours if h >= target)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "         return sum(h >= target for h in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        ans=0\n",
    "        for each in hours:\n",
    "            if each>=target:\n",
    "                ans +=1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return len([hour for hour in hours if hour >= target])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        count = 0\n",
    "        for i in range(len(hours)):\n",
    "            if hours[i] >= target:\n",
    "                count += 1\n",
    "        return count\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, s: List[int], t: int) -> int:\n",
    "        return sum([1 for v in s if v >= t])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        hours.sort()\n",
    "        n = len(hours)\n",
    "        res = []\n",
    "        ans = len(res)\n",
    "        for i in range(n):\n",
    "            if hours[i] >= target:\n",
    "                res.append(i)\n",
    "        return len(res)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(1 if h >= target else 0 for h in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        n = 0\n",
    "        for i in range(len(hours)):\n",
    "            if hours[i] >= target:\n",
    "                n += 1\n",
    "        return n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        res=0\n",
    "        for i in hours:\n",
    "            if i>=target:\n",
    "                res+=1\n",
    "\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "      s=0\n",
    "      for i in range (0,len(hours)):\n",
    "        if hours[i]>=target:\n",
    "          s=s+1\n",
    "      return s\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        \n",
    "        ans = 0 \n",
    "        for x in hours:\n",
    "            if x>=target:\n",
    "                ans += 1\n",
    "        return ans "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        a=0\n",
    "        for i in hours:\n",
    "            \n",
    "            if i >= target:\n",
    "                a+=1\n",
    "        return a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(ans >= target for ans in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum(h >= target for h in hours)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        # hours = [0,1,2,3,4]\n",
    "        # target = 2\n",
    "        counter=0\n",
    "        if 1 <= len(hours) <= 50:\n",
    "            if 0 <= target <= 10**5 :\n",
    "\n",
    "                for i in range(len(hours)):\n",
    "                    \n",
    "                    if hours[i] >= target:\n",
    "                        counter += 1\n",
    "        return counter\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        cnt = 0 \n",
    "        for _ in hours:\n",
    "            if _ >= target:\n",
    "                cnt += 1\n",
    "        return cnt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        count = 0\n",
    "        for i in hours:\n",
    "            if i >= target:\n",
    "                count += 1\n",
    "        return count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:\n",
    "        return sum([1 for n in hours if n >= target])"
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 2
}
